<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">
<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>


  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta name="description" content="修改host文件12345cat &amp;lt;&amp;lt;/etc/hosts&amp;gt;&amp;gt;EOF172.16.70.251 master-1172.16.70.252 master-2172.16.70.1 master-3EOF 安装docker-ce12345sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-c">
<meta property="og:type" content="article">
<meta property="og:title" content="kubeadm k8s HA 高可用集群搭建">
<meta property="og:url" content="http://nfvpn.com/2019/01/12/kubeadm-k8s-HA-高可用集群搭建/index.html">
<meta property="og:site_name" content="网探NFVPN">
<meta property="og:description" content="修改host文件12345cat &amp;lt;&amp;lt;/etc/hosts&amp;gt;&amp;gt;EOF172.16.70.251 master-1172.16.70.252 master-2172.16.70.1 master-3EOF 安装docker-ce12345sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-c">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-01-12T11:29:32.416Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="kubeadm k8s HA 高可用集群搭建">
<meta name="twitter:description" content="修改host文件12345cat &amp;lt;&amp;lt;/etc/hosts&amp;gt;&amp;gt;EOF172.16.70.251 master-1172.16.70.252 master-2172.16.70.1 master-3EOF 安装docker-ce12345sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-c">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://nfvpn.com/2019/01/12/kubeadm-k8s-HA-高可用集群搭建/">





  <title>kubeadm k8s HA 高可用集群搭建 | 网探NFVPN</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">网探NFVPN</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://nfvpn.com/2019/01/12/kubeadm-k8s-HA-高可用集群搭建/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Yokiy">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="网探NFVPN">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">kubeadm k8s HA 高可用集群搭建</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-12T13:35:27+08:00">
                2019-01-12
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="修改host文件"><a href="#修改host文件" class="headerlink" title="修改host文件"></a>修改host文件</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">cat &lt;&lt;/etc/hosts&gt;&gt;EOF</span><br><span class="line">172.16.70.251 master-1</span><br><span class="line">172.16.70.252 master-2</span><br><span class="line">172.16.70.1 master-3</span><br><span class="line">EOF</span><br></pre></td></tr></table></figure>
<h3 id="安装docker-ce"><a href="#安装docker-ce" class="headerlink" title="安装docker-ce"></a>安装docker-ce</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo</span><br><span class="line">sudo yum makecache fast</span><br><span class="line">sudo yum -y update</span><br><span class="line">sudo yum install docker-ce -y</span><br><span class="line">sudo systemctl start docker</span><br></pre></td></tr></table></figure>
<h3 id="配置阿里云k8syum仓库"><a href="#配置阿里云k8syum仓库" class="headerlink" title="配置阿里云k8syum仓库"></a>配置阿里云k8syum仓库</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">cat &lt;&lt;EOF &gt; /etc/yum.repos.d/kubernetes.repo</span><br><span class="line">[kubernetes]</span><br><span class="line">name=Kubernetes</span><br><span class="line">baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64</span><br><span class="line">enabled=1</span><br><span class="line">gpgcheck=0</span><br><span class="line">repo_gpgcheck=0</span><br><span class="line">gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg</span><br><span class="line">EOF</span><br></pre></td></tr></table></figure>
<h3 id="初始化环境，升级内核"><a href="#初始化环境，升级内核" class="headerlink" title="初始化环境，升级内核"></a>初始化环境，升级内核</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">systemctl disable --now firewalld NetworkManager</span><br><span class="line">setenforce 0</span><br><span class="line">sed -ri &apos;/^[^#]*SELINUX=/s#=.+$#=disabled#&apos; /etc/selinux/config</span><br><span class="line">systemctl disable --now dnsmasq</span><br><span class="line">swapoff -a &amp;&amp; sysctl -w vm.swappiness=0</span><br><span class="line">sed -ri &apos;/^[^#]*swap/s@^@#@&apos; /etc/fstab</span><br><span class="line">yum install epel-release -y</span><br><span class="line">yum install wget git jq psmisc -y</span><br><span class="line">yum update -y</span><br><span class="line">[ ! -f /usr/bin/perl ] &amp;&amp; yum install perl -y</span><br><span class="line">rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org</span><br><span class="line">rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm</span><br><span class="line">export Kernel_Version=4.18.9-1</span><br><span class="line">wget http://mirror.rc.usf.edu/compute_lock/elrepo/kernel/el7/x86_64/RPMS/kernel-ml&#123;,-devel&#125;-$&#123;Kernel_Version&#125;.el7.elrepo.x86_64.rpm</span><br><span class="line">yum localinstall -y kernel-ml*</span><br><span class="line">find /lib/modules -name &apos;*nf_conntrack_ipv4*&apos; -type f</span><br><span class="line">grub2-set-default 0 &amp;&amp; grub2-mkconfig -o /etc/grub2.cfg</span><br><span class="line">grubby --default-kernel</span><br><span class="line">grubby --args=&quot;user_namespace.enable=1&quot; --update-kernel=&quot;$(grubby --default-kernel)&quot;</span><br><span class="line">reboot</span><br></pre></td></tr></table></figure>
<h3 id="安装IPVS"><a href="#安装IPVS" class="headerlink" title="安装IPVS"></a>安装IPVS</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">yum install ipvsadm ipset sysstat conntrack libseccomp -y</span><br><span class="line">:&gt; /etc/modules-load.d/ipvs.conf</span><br><span class="line">module=(</span><br><span class="line">  ip_vs</span><br><span class="line">  ip_vs_lc</span><br><span class="line">  ip_vs_wlc</span><br><span class="line">  ip_vs_rr</span><br><span class="line">  ip_vs_wrr</span><br><span class="line">  ip_vs_lblc</span><br><span class="line">  ip_vs_lblcr</span><br><span class="line">  ip_vs_dh</span><br><span class="line">  ip_vs_sh</span><br><span class="line">  ip_vs_fo</span><br><span class="line">  ip_vs_nq</span><br><span class="line">  ip_vs_sed</span><br><span class="line">  ip_vs_ftp</span><br><span class="line">  )</span><br><span class="line">for kernel_module in $&#123;module[@]&#125;;do</span><br><span class="line">    /sbin/modinfo -F filename $kernel_module |&amp; grep -qv ERROR &amp;&amp; echo $kernel_module &gt;&gt; /etc/modules-load.d/ipvs.conf || :</span><br><span class="line">done</span><br><span class="line">systemctl enable --now systemd-modules-load.service</span><br><span class="line"></span><br><span class="line">cat &lt;&lt;EOF &gt; /etc/sysctl.d/k8s.conf</span><br><span class="line">net.ipv4.ip_forward = 1</span><br><span class="line">net.bridge.bridge-nf-call-ip6tables = 1</span><br><span class="line">net.bridge.bridge-nf-call-iptables = 1</span><br><span class="line">fs.may_detach_mounts = 1</span><br><span class="line">vm.overcommit_memory=1</span><br><span class="line">vm.panic_on_oom=0</span><br><span class="line">fs.inotify.max_user_watches=89100</span><br><span class="line">fs.file-max=52706963</span><br><span class="line">fs.nr_open=52706963</span><br><span class="line">net.netfilter.nf_conntrack_max=2310720</span><br><span class="line">EOF</span><br><span class="line">sysctl --system</span><br></pre></td></tr></table></figure>
<h3 id="安装docker补全"><a href="#安装docker补全" class="headerlink" title="安装docker补全"></a>安装docker补全</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">yum install -y epel-release bash-completion &amp;&amp; cp /usr/share/bash-completion/completions/docker /etc/bash_completion.d/</span><br><span class="line">systemctl enable --now docker</span><br></pre></td></tr></table></figure>
<h3 id="安装k8s组件"><a href="#安装k8s组件" class="headerlink" title="安装k8s组件"></a>安装k8s组件</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install kubeadm kubelet kubectl</span><br></pre></td></tr></table></figure>
<h3 id="拉取k8s镜像"><a href="#拉取k8s镜像" class="headerlink" title="拉取k8s镜像"></a>拉取k8s镜像</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubeadm config images pull --config kubeadm-config.yaml</span><br></pre></td></tr></table></figure>
<h3 id="kubeadm初始化"><a href="#kubeadm初始化" class="headerlink" title="kubeadm初始化"></a>kubeadm初始化</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubeadm init --config kubeadm-config.yml</span><br></pre></td></tr></table></figure>
<h3 id="copy-master-1证书到-master-2-master-3"><a href="#copy-master-1证书到-master-2-master-3" class="headerlink" title="copy master-1证书到 master-2 master-3"></a>copy master-1证书到 master-2 master-3</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">USER=root</span><br><span class="line">CONTROL_PLANE_IPS=&quot;master-2 master-3&quot;</span><br><span class="line">for host in $&#123;CONTROL_PLANE_IPS&#125;; do</span><br><span class="line">    scp /etc/kubernetes/pki/ca.crt &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/pki/ca.key &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/pki/sa.key &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/pki/sa.pub &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/pki/front-proxy-ca.crt &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/pki/front-proxy-ca.key &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/</span><br><span class="line">    scp /etc/kubernetes/admin.conf &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/</span><br><span class="line">    scp /etc/kubernetes/pki/etcd/ca.crt &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/etcd/ca.crt</span><br><span class="line">    scp /etc/kubernetes/pki/etcd/ca.key &quot;$&#123;USER&#125;&quot;@$host:/etc/kubernetes/pki/etcd/ca.key</span><br><span class="line">done</span><br></pre></td></tr></table></figure>
<h3 id="安装calico"><a href="#安装calico" class="headerlink" title="安装calico"></a>安装calico</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- quay.io/calico/node:v3.4.0</span><br><span class="line">curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- quay.io/calico/cni:v3.4.0</span><br><span class="line">curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- quay.io/calico/kube-controllers:v3.4.0</span><br><span class="line">curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- quay.io/coreos/etcd:v3.3.9</span><br><span class="line">kubectl apply -f https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/etcd.yaml</span><br><span class="line">kubectl apply -f https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml</span><br></pre></td></tr></table></figure>
<h3 id="安装metrics-server"><a href="#安装metrics-server" class="headerlink" title="安装metrics-server"></a>安装metrics-server</h3><ol>
<li><p>拉取yaml文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/kubernetes-incubator/metrics-server.git</span><br><span class="line">vim deploy/1.8+/metrics-server-deployment.yaml</span><br></pre></td></tr></table></figure>
</li>
<li><p>增加 spec.template.spec.containers.command:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">command</span>:</span><br><span class="line">- /metrics-server</span><br><span class="line">- --kubelet-insecure-tls</span><br><span class="line">- --kubelet-preferred-address-types=InternalIP</span><br><span class="line">imagePullPolicy: IfNotPresent  <span class="comment">## 修改 imagePullPolicy: IfNotPresent 否咋镜像拉取不到</span></span><br></pre></td></tr></table></figure>
<ul>
<li><a href="https://github.com/kubernetes-incubator/metrics-server/issues/131" target="_blank" rel="noopener">解决节点hostname无法解析issue</a></li>
</ul>
</li>
<li><p>拉取镜像</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl -s https://zhangguanzhang.github.io/bash/pull.sh | bash -s -- k8s.gcr.io/metrics-server-amd64:v0.3.1</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建metrics-server</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl create -f deploy/1.8+/</span><br></pre></td></tr></table></figure></li>
</ol>

      
    </div>
    
    
    
    <div>
          
            

          
    </div>
    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/08/07/Python-SDK-阿里云容器镜像仓库/" rel="next" title="Python SDK 阿里云容器镜像仓库">
                <i class="fa fa-chevron-left"></i> Python SDK 阿里云容器镜像仓库
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
      <div>
        
          <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

        
      </div>
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Yokiy</p>
              <p class="site-description motion-element" itemprop="description">记录一些工作经验</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">19</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#修改host文件"><span class="nav-number">1.</span> <span class="nav-text">修改host文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装docker-ce"><span class="nav-number">2.</span> <span class="nav-text">安装docker-ce</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置阿里云k8syum仓库"><span class="nav-number">3.</span> <span class="nav-text">配置阿里云k8syum仓库</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#初始化环境，升级内核"><span class="nav-number">4.</span> <span class="nav-text">初始化环境，升级内核</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装IPVS"><span class="nav-number">5.</span> <span class="nav-text">安装IPVS</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装docker补全"><span class="nav-number">6.</span> <span class="nav-text">安装docker补全</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装k8s组件"><span class="nav-number">7.</span> <span class="nav-text">安装k8s组件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#拉取k8s镜像"><span class="nav-number">8.</span> <span class="nav-text">拉取k8s镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#kubeadm初始化"><span class="nav-number">9.</span> <span class="nav-text">kubeadm初始化</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#copy-master-1证书到-master-2-master-3"><span class="nav-number">10.</span> <span class="nav-text">copy master-1证书到 master-2 master-3</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装calico"><span class="nav-number">11.</span> <span class="nav-text">安装calico</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装metrics-server"><span class="nav-number">12.</span> <span class="nav-text">安装metrics-server</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Yokiy</span>

  
</div>
<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_pv">
  本站访客数:<span id="busuanzi_value_site_uv"></span>
</span>
</div>

  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共7.7k字</span>
  <a href="http://www.miitbeian.gov.cn">备案号：湘ICP备16017335号</a>
</div>

        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
